//
//  BIZContractCell.m
//  ConsultantVersion
//
//  Created by 小龙 on 2017/4/18.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "BIZContractCell.h"
@interface BIZContractCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *requireLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UILabel *companyNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *posiationLabel;
@property (weak, nonatomic) IBOutlet UIView *redView;

@end

@implementation BIZContractCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setContractModel:(BIZContractModel *)contractModel
{
    _contractModel = contractModel;
    [SDWebImageTool imageView:self.headImageView imageName:contractModel.headImg placeHolder:@"default-head" showProgress:NO];
    self.nameLabel.text = contractModel.cname;
    self.companyNameLabel.text = contractModel.fname;
    self.requireLabel.text = contractModel.content;
    self.dateLabel.text = [NSDate stringFromTimestamp:contractModel.comTime];
    self.posiationLabel.text = contractModel.position;
    
    if ([contractModel.redType integerValue] == 1) {
        self.redView.hidden = NO;
    } else {
        self.redView.hidden = YES;
    }
    
    /** 状态：状态: 0 初始 未接单 1 接单 2 拒单 3 已回传 4服务完成 5过期 */
    switch ([contractModel.status integerValue]) {
            case 0:
        {
            self.statusLabel.text = @"咨询师未接单";
            self.statusLabel.textColor = HEXCOLOR(0xfb6a31);
        }
            break;
            case 1:
        {
            self.statusLabel.text = @"咨询师已接单";
            self.statusLabel.textColor = HEXCOLOR(0x00c44e);
        }
            break;
            
            case 2:
        {
            self.statusLabel.text = @"咨询师已拒单";
            self.statusLabel.textColor = HEXCOLOR(0x2079EF);
        }
            break;
            
            case 3:
        {
            self.statusLabel.text = @"咨询师已回传合同";
            self.statusLabel.textColor = HEXCOLOR(0x00c44e);

        }
            break;
            
            case 4:
        {
            self.statusLabel.text = @"服务完成";
            self.statusLabel.textColor = HEXCOLOR(0xffa200);
        }
            break;
            
            case 5:
        {
            self.statusLabel.text = @"过期";
            self.statusLabel.textColor = HEXCOLOR(0xfb6a31);
        }
            break;
            
        default:
        {
            self.statusLabel.text = @"服务无响应";
            self.statusLabel.textColor = HEXCOLOR(0xcc100f);
        }
            break;
    }
}

@end
